public class code4 {
    public static int fib(int n){
        if(n==0||n==1)
            return 1;
        int p=1,q=1,r=0;
        for(int i=2;i<=n;i++){
            r=p+q;
            p=q;
            q=r;
        }
        return r;
    }
    public static void main(String[] args) {
        for(int i=0;i<=10;i++){
            System.out.print(fib(i)+" ");
        }

    }
}
